{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e1dae701",
   "metadata": {},
   "source": [
    "# 其他工具"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "969588b9",
   "metadata": {},
   "source": [
    "## 1. 可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30979392",
   "metadata": {},
   "source": [
    "### 1.1 线路可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "062a1fb3",
   "metadata": {},
   "source": [
    "量子线路支持以文本格式和图像格式进行可视化展示，便于用户理解和调试量子操作流程。"
   ]
  },
  {
   "cell_type": "code",
   "id": "b08e52be",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:09.171465Z",
     "start_time": "2025-06-10T02:56:07.811981Z"
    }
   },
   "source": [
    "from math import pi\n",
    "from cqlib import Circuit, Parameter\n",
    "\n",
    "theta = Parameter('theta')\n",
    "phi = Parameter('phi')\n",
    "c = Circuit(3, [theta, phi])\n",
    "c.h(0)\n",
    "c.rx(1, 0.2)\n",
    "c.rx(2, pi / 2)\n",
    "c.cx(0, 1)\n",
    "c.cx(0, 2)\n",
    "c.rz(0, theta)\n",
    "c.crz(1, 2, theta + phi)\n",
    "c.barrier(0, 1, 2)\n",
    "c.measure_all()"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "cell_type": "markdown",
   "id": "c6db98d7",
   "metadata": {},
   "source": [
    "文本格式可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cbac3b42",
   "metadata": {},
   "source": [
    "支持以字符图的形式展示线路结构，适用于终端环境的快速查看。"
   ]
  },
  {
   "cell_type": "code",
   "id": "18fa3638",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:10.269991Z",
     "start_time": "2025-06-10T02:56:09.198507Z"
    }
   },
   "source": "print(c.draw('text'))",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                             \n",
      " Q0: ──────H─────■──■─────RZ(theta)─────│──M─\n",
      "                 │  │                   │    \n",
      " Q1: ───RX(0.2)──X──┼─────────■─────────│──M─\n",
      "                    │         │         │    \n",
      " Q2: ───RX(π/2)─────X──RZ(phi + theta)──│──M─\n",
      "                                             \n",
      "\n",
      "\n"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "cell_type": "code",
   "id": "f28dc82e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:11.504007Z",
     "start_time": "2025-06-10T02:56:11.292899Z"
    }
   },
   "source": "_ = c.draw('mpl')",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 856x300 with 1 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAqsAAAD7CAYAAABNCt0vAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjMsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvZiW1igAAAAlwSFlzAAAPYQAAD2EBqD+naQAAN4VJREFUeJzt3QlYlWX6BvAbWUVQEUHFnUTFHdBUXCrH0ixsTK0sTSdNnbJ/jjVqY2aNpbY51bSpLabJqFlOWk2paWm5pVgaYu6KiAuCLCL7+V/P+3FYD5uc5Tvn3L/r+q4D53yH83IivHm/531eF4PBYAARERERkQ7VsfUAiIiIiIgqwrBKRERERLrFsEpEREREusWwSkRERES6xbBKRERERLrFsEpEREREusWwSkRERES6xbBKRERERLrFsEpEREREuuVm6wEQERGRfZs/H8jPL3+/qyswd64tRkSOxIXbrRIREVFteHoCOTnl7/fwALKzbTEiciQsAyAiIiIi3WJYJSIiIiLdYlglIiIiIt1iWCUiIiIi3WJYJSIiIiLdYlglIiIiIt1iWCUiIiIi3WJYJSIiIiLdYlglIiIiIt1iWCUiIiIi3WJYJSIiIiLdYlglIiIiIt1ys/UAiIiIiPRs6dKlyMjIgLPy8fHB5MmTbfb6DKuW5OICp2Uw2HoERFRGzw1wSvuG23oEZO8kqKanp9t6GE6LYZWIiIioGlxcXNQsozOFdIMOJp8YVomIiIiqQYLqj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70bXE9b1oOMLI1kJmnXer//ap22V9qf6d3AgK9gGu5wKCgGw/QRGX1799f7eop26JWpwRAVvIL2aK+tgYOHIisrCzVKkvCak0WaukJw6qdu7gnTjX8bzs8EoE928PV0121sSqrURdtmqDrtD+Xe+zCzliGVSI79Mw+YGpHYFqoNkO45iTwptbpxi4cvgq8F6ctjpKNDaSEoaabEkhbqvHbgUc7aDOs/l5Aag5wIl1rSWUk749sAiDtqJ7pBrjVKd4U4G97gL93BSaEADn5wLZErdOCtMkiqi3Zoaq6JNBKuBTGWdHakK1bHQHDqh2RULq8mbYvsFFBTh6+vXee+rjPwknw734Tskxc4i/7PCKyf9JAv6qm9RWtyB+uLTQu8lUli5SqUvZr1cSHx7TjRsdtfB9eOaQdlZFZWznKktnVx020m65tNwOimlq7dq26Ldl6ihhWHUpy7GnEb658IwAiIiLSH7lMb+wCINvWUzGGVQdy9NNaTG8QERGRzWzbtk3dRkZG2noousNuAEREREQ2du6c1jtt8ODBth6K7nBmlYjIziz9QzuIyHFERUWpFlP2umLfkhhWiYiIiGzMz89PHVQeywCIiIiISLc4s0pERERUDRkZGVi8eDGc6fvVA4ZVC5qQuM7WQyCqFsPBibYegsPZN9zWIyAiS7SXSk9Pt/UwnA7DKhEREVElfHx84Mx8bPz9uxjkzwQiIiKiG+TpKVuFlr/fwwPIzrbFiMiRcIEVEREREekWwyoRERER6RbDKhERERHpFsMqEREREekWuwEQERFRrfj6VrzAiqi22A2AiIiIiHSLZQBEREREpFsMq0RERESkWwyrRERERKRbDKtEREREpFsMq0RERESkWwyrRERERKRbDKtEREREpFsMq0RERESkWwyrRERERKRbDKtEREREpFsMq0RERESkWwyrRERERKRbDKtEREREpFsMq0RERESkWwyrRERERKRbDKtEREREBL36f67MI9RgNphzAAAAAElFTkSuQmCC"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 3
  },
  {
   "cell_type": "markdown",
   "id": "b582ee08",
   "metadata": {},
   "source": [
    "### 1.2 结果可视化"
   ]
  },
  {
   "cell_type": "code",
   "id": "40cf95be",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:13.022449Z",
     "start_time": "2025-06-10T02:56:12.118529Z"
    }
   },
   "source": [
    "from math import pi\n",
    "\n",
    "from cqlib import Circuit\n",
    "from cqlib.simulator import StatevectorSimulator\n",
    "from cqlib.visualization import draw_histogram, draw_gplot\n",
    "\n",
    "c = Circuit(2)\n",
    "c.rx(1, pi / 4)\n",
    "c.cx(0, 1)\n",
    "c.measure_all()\n",
    "\n",
    "sim = StatevectorSimulator(c)\n",
    "probs = sim.probs()\n",
    "print(f'probs: {probs}')\n",
    "_ = draw_histogram(probs, title='result probs')"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "probs: {'00': 0.8535533905932737, '01': 0.0, '10': 0.14644660940672624, '11': 0.0}\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGwCAYAAAB7MGXBAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjMsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvZiW1igAAAAlwSFlzAAAPYQAAD2EBqD+naQAAKVlJREFUeJzt3QtUVWX+//EvoICXQA0FJZTMEk0FA0HURptIuoyT1TRojRCjtCpzSnJKKsFb4qWIVVFMrszWNI5ko02NDk2xtJYjRUFOZkjeCjS5VYLiTyg4//U8/3VOoEAcPPjA4f1aa6d7n2dvnuPueD4+t+1isVgsAgAAYIirqR8MAACgEEYAAIBRhBEAAGAUYQQAABhFGAEAAEYRRgAAgFGEEQAAYBRhBAAAGEUYAQAARhFGAHSIwMBASU9Pl85i165d4uLiIidPnjRdFQDnIIwAuChUEHjrrbdMVwNAJ0QYAbqZuro6cSbq8Vo//fST6WoAuACEEcDJTZs2TR588EF5+OGHxcfHR6Kjo/XxL774Qm666Sbp27ev+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n2F87r88st16Gh876urq/WsGu49uqsepiuAX6amf8bFxUlYWJiEh4dLenq6nkIWHx+vB77NnTtXlxkwYIBek2LBggX6L7WJEyearjraeV8V65igQ4cO6f19+/bJJZdcogcnq3uNzuv06dO2+2YdtKrWnFD3Td2/hx9+WFauXClXXnmlDidLlizRa1fMnDnTaL1xYff1+++/1/8QVMsrWP9hqFhbsdEK09N50DbPP/+8ZejQoRZ3d3c9JfSjjz6yvfZ///d/lgceeMDSv39/S+/evS233Xab5cSJE0briwu/rykpKXp64Lnbq6++arTO+GXW6djnbnFxcbbpvUuWLLH4+vrqKb3XX3+9paioyHS1cYH3VX02m3tdfZbROhf1n9bCCgAAQEdizAgAADCKMAIAAIwijAAAAKMIIwAAwCjCCAAAMIowAgAAjCKMAAAAowgjAADAKMIIAAAwijACAACMIowAAAAx6f8B9zBB7C9dC+8AAAAASUVORK5CYII="
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 4
  },
  {
   "cell_type": "markdown",
   "id": "8e5a91c2",
   "metadata": {},
   "source": [
    "## 2. 量子指令集"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99f76558",
   "metadata": {},
   "source": [
    "Cqlib 是基于 QCIS （Quantum Control Instruction Set）构建，并支持与 OpenQASM2.0 指令集的相互转换，方便在不同平台兼容与迁移。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5a66695",
   "metadata": {},
   "source": [
    "### 2.1 QCIS"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7eb7be09",
   "metadata": {},
   "source": [
    "QCIS(Quantum Control Instruction Set)是转为超导量子计算机硬件设计的一套量子控制指令集，旨在对底层物理操作进行抽象标准化。\n",
    "- 与 QASM(Quantum Assembly Language）相比，QCIS更贴近底层物理系统，而QASM更侧重量子门级的抽象表示。"
   ]
  },
  {
   "cell_type": "code",
   "id": "7477a2ed",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:13.115310Z",
     "start_time": "2025-06-10T02:56:13.089873Z"
    }
   },
   "source": [
    "from cqlib import Circuit\n",
    "\n",
    "c = Circuit(2)\n",
    "c.rx(1, pi / 4)\n",
    "c.cx(0, 1)\n",
    "c.measure_all()\n",
    "\n",
    "print(c.as_str())"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RX Q1 0.7853981633974483\n",
      "CX Q0 Q1\n",
      "M Q0\n",
      "M Q1\n"
     ]
    }
   ],
   "execution_count": 5
  },
  {
   "cell_type": "markdown",
   "id": "847f724c",
   "metadata": {},
   "source": "- Cqlib 提供 Circuit.qcis 属性，可直接输出分解为 QCIS 指令的量子门列表，便于下发至实际硬件执行。"
  },
  {
   "cell_type": "code",
   "id": "38c7e8ff",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:13.392453Z",
     "start_time": "2025-06-10T02:56:13.376097Z"
    }
   },
   "source": [
    "print(c.qcis)"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RX Q1 0.7853981633974483\n",
      "H Q1\n",
      "CZ Q0 Q1\n",
      "H Q1\n",
      "M Q0\n",
      "M Q1\n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "cell_type": "markdown",
   "id": "5c1225db",
   "metadata": {},
   "source": [
    "示例：加载 QCIS 指令以支持在底层物理量子设备上运行。"
   ]
  },
  {
   "cell_type": "code",
   "id": "3cb10093",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:13.796971Z",
     "start_time": "2025-06-10T02:56:13.785113Z"
    }
   },
   "source": [
    "qcis = \"\"\"\n",
    "RX Q1 0.7853981633974483\n",
    "CX Q0 Q1\n",
    "H Q0\n",
    "CZ Q0 Q1\n",
    "M Q0\n",
    "M Q1\n",
    "\"\"\"\n",
    "\n",
    "c = Circuit.load(qcis)\n",
    "print(c.draw())"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            \n",
      " Q0: ────────────■──H──■──M─\n",
      "                 │     │    \n",
      " Q1: ───RX(π/4)──X─────■──M─\n",
      "                            \n",
      "\n",
      "\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "cell_type": "markdown",
   "id": "cc4b4836",
   "metadata": {},
   "source": [
    "### 2.2 OpenQASM2.0"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "839798a7",
   "metadata": {},
   "source": [
    "OpenQASM 2.0 是一种广泛使用的量子汇编语言标准，用于构建和描述量子电路，支持经典-量子混合编程。\n",
    "- 可作为仿真机或真机平台的通用中间表示（IR），便于跨平台部署。\n",
    "- Cqlib支持将 OpenQASM 2.0 代码加载为量子线路对象，并可将现有量子线路导出为 QASM 格式。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b922e023",
   "metadata": {},
   "source": [
    "生成量子线路"
   ]
  },
  {
   "cell_type": "code",
   "id": "2b0143b2",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:14.157345Z",
     "start_time": "2025-06-10T02:56:14.108717Z"
    }
   },
   "source": [
    "from cqlib import Circuit\n",
    "from cqlib.utils import qasm2\n",
    "\n",
    "c = Circuit(2)\n",
    "c.rx(1, pi / 4)\n",
    "c.cx(0, 1)\n",
    "c.measure_all()\n",
    "\n",
    "qasm = qasm2.dumps(c)\n",
    "print(qasm)"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "// Generated by Cqlib v1.3.4\n",
      "\n",
      "OPENQASM 2.0;\n",
      "include \"qelib1.inc\";\n",
      "\n",
      "qreg q[2];\n",
      "\n",
      "creg c[2];\n",
      "\n",
      "rx(0.7853981634) q[1];\n",
      "cx q[0], q[1];\n",
      "measure q[0] -> c[0];\n",
      "measure q[1] -> c[1];\n"
     ]
    }
   ],
   "execution_count": 8
  },
  {
   "cell_type": "markdown",
   "id": "68e91d64",
   "metadata": {},
   "source": [
    "示例：从 OpenQASM 文件加载线路，或生成符合 OpenQASM 规范的代码。"
   ]
  },
  {
   "cell_type": "code",
   "id": "6fb14128",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-10T02:56:14.422406Z",
     "start_time": "2025-06-10T02:56:14.378017Z"
    }
   },
   "source": [
    "from cqlib.utils import qasm2\n",
    "from cqlib.visualization import draw_text\n",
    "\n",
    "qasm = \"\"\"\n",
    "OPENQASM 2.0;\n",
    "include \"qelib1.inc\";\n",
    "\n",
    "qreg q[2];\n",
    "creg c[2];\n",
    "\n",
    "h q[0];\n",
    "rx(0.7853981634) q[1];\n",
    "cx q[0], q[1];\n",
    "h q[1];\n",
    "barrier q;\n",
    "\n",
    "measure q[0] -> c[0];\n",
    "measure q[1] -> c[1];\n",
    "\"\"\"\n",
    "\n",
    "c = qasm2.loads(qasm)\n",
    "print(c.draw())\n"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            \n",
      " Q0: ──────H─────■─────│──M─\n",
      "                 │     │    \n",
      " Q1: ───RX(π/4)──X──H──│──M─\n",
      "                            \n",
      "\n",
      "\n"
     ]
    }
   ],
   "execution_count": 9
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "cqlib3.10",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
